// pages/membershipcard/membershipcard.js
const app = getApp();
import api from '../../../../utils/util.js';
Page({
  /**
   * 页面的初始数据
   */
  data: {
    statusBarHeight: app.globalData.statusBarHeight,
    fullHeight: app.globalData.fullcontain,
    navmess:{
      navtitle: "会员卡账户",
      backhide: 0,
      topheight: 1
    },
    cardmessage:[
      {
        "realName": "特朗普",
        "mobile": "13569874561",
        "rechargeCardNo": "8888343090394888",
        "createTime": "2020-08-26 11:02:34",
        "rechargeCardName": "公主卡",
        "balance": 38800.00,
        "giveBalance": 0,
        "nextCardName": "女王卡",
        "nextLevelAmt": -100,
        "cardPhoto": [
          {
            "photoUrl": "",
            "name": "公主卡"
          },
          {
            "photoUrl": "",
            "name": "女王卡"
          },
          {
            "photoUrl": "",
            "name": "钻石卡"
          },
          {
            "photoUrl": "1",
            "name": "vip卡"
          },
          {
            "photoUrl": "无",
            "name": "霸王卡"
          }
        ],
        "cardList": [
          {
            "name": "公主卡",
            "type": 1,
            "projectDiscount": 100,
            "productDiscount": 100,
            "treatmentDiscount": 100,
            "minAmt": 100,
            "photoUrl": "",
            "typeValueValue": "数字卡"
          },
          {
            "name": "女王卡",
            "type": 1,
            "projectDiscount": 100,
            "productDiscount": 100,
            "treatmentDiscount": 100,
            "minAmt": 300,
            "photoUrl": "",
            "typeValueValue": "数字卡"
          },
          {
            "name": "钻石卡",
            "type": 1,
            "projectDiscount": 100,
            "productDiscount": 100,
            "treatmentDiscount": 100,
            "minAmt": 300,
            "photoUrl": "",
            "typeValueValue": "数字卡"
          },
          {
            "name": "vip卡",
            "type": 1,
            "projectDiscount": 1,
            "productDiscount": 1,
            "treatmentDiscount": 1,
            "minAmt": 400,
            "photoUrl": "1",
            "typeValueValue": "数字卡"
          },
          {
            "name": "霸王卡",
            "type": 1,
            "projectDiscount": 89,
            "productDiscount": 56,
            "treatmentDiscount": 51,
            "minAmt": 120000,
            "photoUrl": "无",
            "typeValueValue": "数字卡"
          }
        ]
      }
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    console.log("充值记录权限", options)
    that.setData({
      rights: options.mesObj
    })
    var token = wx.getStorageSync('token');
    that.setData({
      token: token
    })
    api.post("/mini/my/account/rechargeCard",{
      "token": token
    }).then(res => {
      console.log(res)
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})